package com.nbsaas.boot.tenant.data.entity;

import com.nbsaas.boot.code.annotation.FormAnnotation;
import com.nbsaas.boot.code.annotation.FormField;
import com.nbsaas.boot.code.annotation.SearchItem;
import com.nbsaas.boot.jpa.data.entity.LongEntity;
import com.nbsaas.boot.rest.filter.Operator;
import lombok.Data;
import org.hibernate.annotations.Comment;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;


@Entity
@FormAnnotation(model = "数据源管理" )
@Data
@Table(name = "saas_sys_tenant")
public class Database extends LongEntity {



    @SearchItem(label = "域名", name = "domain",operator = Operator.eq)
    @Comment("域名")
    @FormField(title = "域名", sortNum = "1", grid = true, col = 12)
    @Column(length = 50)
    private String domain;

    @FormField(title = "jdbcUrl",sortNum = "1", grid = true,col = 22,required = true,width = "10000")
    private String url;

    @FormField(title = "用户名",sortNum = "1", grid = true,col = 22,required = true)
    private String username;

    @FormField(title = "密码",sortNum = "1", grid = true,col = 22,required = true)
    private String password;

    @FormField(title = "数据库驱动",sortNum = "1", grid = true,col = 22,required = true,width = "200")
    private String driverClassName;

    // Getters and setters
}
